export const InitModalMethod = [];
export const ParseModalMethod = [];

// 替换 HTML 片段
export const replaceHtmlFragment = htmlFragment => {
	const pattern = /<(\S*?)[^>]*>.*?|<.*? \/>/gi;
	// eslint-disable-next-line no-useless-escape
	const imgPattern = /<img.*?src=[\"|\']?(.*?)[\"|\']?\s.*?>/gi;
	let fragments = htmlFragment
		.replace(imgPattern, '[图片]')
		.replace(pattern, '')
		.replace(/&nbsp;/, '')
		.replace(/&nbsp;/gi, '');
	return fragments;
};
